package com.utils;

import org.junit.Test;

import java.util.ArrayList;

public class ArrayToStr5 {

    @Test
    public void test() {
        ArrayList<Long> list = new ArrayList<>();
        String[] lStrArray = numStr.split("\n");
        for (String lStr : lStrArray) {
            list.add(Long.valueOf(lStr));
        }
//        list.sort(Long::compareTo);
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < list.size(); ++i) {
            sb.append(list.get(i)).append(",");
            if (i > 0 && i % 3000 == 0) {
                System.out.println("第" + (i / 3000) + "波, 数量共: " + list.size());
                System.out.println(sb);
                sb = new StringBuilder();
            }
        }
        System.out.println("数量共: " + list.size());
        System.out.println(sb);
    }

    String numStr = "20276656\n" +
            "20276655\n" +
            "20276654\n" +
            "20276653\n" +
            "20276652\n" +
            "20276651\n" +
            "20276344\n" +
            "20276343\n" +
            "20276342\n" +
            "20276341\n" +
            "20276340\n" +
            "20276339\n" +
            "20276338\n" +
            "19322350\n" +
            "19322349\n" +
            "19001295\n" +
            "19001294\n" +
            "19001293\n" +
            "19001292\n" +
            "19001291";
}
